package DailyQuestion;

public class getTargetCopy {
    public static void main(String[] args) {

    }
    TreeNode ans = new TreeNode();
    public final TreeNode getTargetCopy(final TreeNode original, final TreeNode cloned, final TreeNode target) {
        if(original == null)
            return null;
        find(cloned,target);
        return ans;
    }
    public void find(final TreeNode cloned, final TreeNode target){
        if(cloned == null){
            return;
        }
        if(target.val == cloned.val){
            ans = cloned;
        }
        find(cloned.left,target);
        find(cloned.right,target);
    }
}
